﻿using Beryl.OrderChanger;
using Beryl.OrderControllers;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;

namespace Beryl
{
    /// <summary>
    /// OrderChanges 的摘要说明
    /// 销售订单统一请求页面
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class OrderChanges : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod(Description = "查找用户")]
        public string[] CheckUser(string para)
        {
            return userController.Instance.getUser(para).ToArray();
        }
        [WebMethod(Description = "新增用户")]
        public string[] UserAdd(string para)
        {
            return userController.Instance.UserAdd(para).ToArray();
        }


        [WebMethod(Description = "查找用户列表")]
        public string[] UserQuery(string para)
        {
            return userController.Instance.UserQuery(para).ToArray();
        }

        [WebMethod(Description = "销售订单初始信息查找")]
        public string[] getMessage(string para)
        {
            return OrderController.orderController.Instance.getTableData(para).ToArray();
        }

        [WebMethod(Description = "增加销售订单")]
        public string[] SaleAdd(string para)
        {
            return OrderController.orderController.Instance.SaleOrderAdd(para).ToArray();
        }

        [WebMethod(Description = "更新销售订单")]
        public string[] SaleUpdate(string para)
        {
            return OrderController.orderController.Instance.SaleOrderUpdate(para).ToArray();
        }

        [WebMethod(Description = "销售订单转生产订单")]
        public string[] getOrderToProduct(string para)
        {
            return OrderController.orderController.Instance.changeOrderDeal(para).ToArray();
        }

        [WebMethod(Description = "重工单加载页面时查询数据")]
        public string[] reWorkQueryFrist(string para)
        {
            return reWork.Instance.getReWorkFrist(para).ToArray();
        }

        [WebMethod(Description = "重工单查询数据")]
        public string[] reWorkQuery(string para)
        {
            return reWork.Instance.getQueryTbale(para).ToArray();
        }


        [WebMethod(Description = "重工单销售订单查询")]
        public string[] cSoNoQuery(string para)
        {
            return reWork.Instance.reWorkcSoNoQuery(para).ToArray();
        }

        [WebMethod(Description = "重工单数据提交")]
        public string[] summitReWorkData(string para)
        {
            return reWork.Instance.reWorkDual(para).ToArray();
        }

        [WebMethod(Description = "查询querySerial")]
        public string[] querySerialNO(string para)
        {
            return reWork.Instance.querySerial(para).ToArray();
        }

        [WebMethod(Description = "主计划页面查询数据")]
        public string[] MainOrder(string para)
        {
            return mainOrder.Instance.QueryData(para).ToArray();
        }

        [WebMethod(Description = "制定主生产计划")]
        public string[] MainPlanCal(string para)
        {
            return mainOrder.Instance.MainOrderCal(para).ToArray();
        }

        [WebMethod(Description = "单独算物料需求")]
        public string[] sumOrder(string para)
        {
            return mainOrder.Instance.sumOrder(para).ToArray();
        }

        [WebMethod(Description = "查询生产订单")]
        public string[] ProductOrders(string para)
        {
            return productOrders.Instance.proOrderQuery(para).ToArray();
        }

        [WebMethod(Description = "转生产批次")]
        public string[] planOrderDepart(string para)
        {
            return productOrders.Instance.ProOrders(para).ToArray();
        }

        [WebMethod(Description = "转生产批次")]
        public string[] ProductOrdersQuery(string para)
        {
            return productOrders.Instance.OrderUpdateQuery(para).ToArray();
        }

        [WebMethod(Description = "固态流传单数据查询")]
        public string[] GTQuery(string para)
        {
            return PrintControllers.PrintDataQuery.TableQuery(para).ToArray();
        }

        [WebMethod(Description = "重工流传单数据查询")]
        public string[] ReWorkPrint(string para)
        {
            return PrintControllers.PrintDataQuery.ReWorkQuery(para).ToArray();
        }

        [WebMethod(Description = "裁切流传单数据查询")]
        public string[] CuttingQuery(string para)
        {
            return PrintControllers.PrintDataQuery.CuttingQuery(para).ToArray();
        }

        [WebMethod(Description = "液态查询excel流传单号")]
        public string[] QueryMolot(string para)
        {
            return PrintControllers.PrintDataQuery.QueryTable(para).ToArray();
        }

        [WebMethod(Description = "生产批次订单状态查询")]
        public string[] QueryOrderStatus(string para)
        {
            return OrderPCQuery.Instance.OrderStatus(para).ToArray();
        }

        [WebMethod(Description = "生产批次订单Tbale查询")]
        public string[] QueryData(string para)
        {
            return OrderPCQuery.Instance.QueryDataTable(para).ToArray();
        }


        [WebMethod(Description = "生产批次订单数量更新")]
        public string[] UpdatePlanQty(string para)
        {
            return OrderPCQuery.Instance.UpdatePlanty(para).ToArray();
        }

        [WebMethod(Description = "生产批次查询工艺路线")]
        public string[] UpdateProcess(string para)
        {
            return OrderPCQuery.Instance.UpdateProcess(para).ToArray();
        }

        [WebMethod(Description = "生产批次查询工艺路径")]
        public string[] QueryPath(string para)
        {
            return OrderPCQuery.Instance.QueryProcessPath(para).ToArray();
        }

        [WebMethod(Description = "生产批次更新工艺路径")]
        public string[] UpdateProcessData(string para)
        {
            return OrderPCQuery.Instance.UpdateProcessData(para).ToArray();
        }

        [WebMethod(Description = "主生产计划查询订单类别")]
        public string[] MainOrderType(string para)
        {
            return MainOrderQuery.Instance.QueryOrderType(para).ToArray();
        }

        [WebMethod(Description = "主生产计划查询订单名字")]
        public string[] MainOrderDescription(string para)
        {
            return MainOrderQuery.Instance.MainODescription(para).ToArray();
        }

        [WebMethod(Description = "主生产计划更新订单")]
        public string[] MainOrderUpdate(string para)
        {
            return MainOrderQuery.Instance.UpdateMainOrder(para).ToArray();
        }

        [WebMethod(Description = "主生产计划撤销订单")]
        public string[] CloseMOrder(string para)
        {
            return MainOrderQuery.Instance.CloseMOrder(para).ToArray();
        }

        [WebMethod(Description = "重工单其他子订单录入查询")]
        public string[] reWorkOrderOrderQuery(string para)
        {
            return Beryl.OrderControllers.reWorkQuery.Instance.OrderOrderQuery(para).ToArray();
        }

        [WebMethod(Description = "重工单其他子订单录入")]
        public string[] orterOrderUpdate(string para)
        {
            return Beryl.OrderControllers.reWorkQuery.Instance.UpdateOrder(para).ToArray();
        }

        [WebMethod(Description = "重工单修改订单")]
        public string[] updateOrderInputData(string para)
        {
            return Beryl.OrderControllers.reWorkQuery.Instance.InputDataQuery(para).ToArray();
        }


        [WebMethod(Description = "重工单修改订单数据插入")]
        public string[] UpdateReWorkOrder(string para)
        {
            return Beryl.OrderControllers.reWorkQuery.Instance.ReWorkUpdate(para).ToArray();
        }


        [WebMethod(Description = "裁切计划数据查询")]
        public string[] CuttingPlanQuery(string para)
        {
            return CuttingPlan.Instance.CuttingPlanQuerys(para).ToArray();
        }

        [WebMethod(Description = "裁切计划人工选择已切首次加载页面")]
        public string[] CuttingCustomF(string para)
        {
            return CuttingPlan.Instance.FirstLoadData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划人工选择已切仓库等数据查询")]
        public string[] CuttingCustomWareHouse(string para)
        {
            return CuttingPlan.Instance.WareHouseDataQuerys(para).ToArray();
        }

        [WebMethod(Description = "裁切计划人工选择初始数据查询")]
        public string[] CuttingCustomQuery(string para)
        {
            return CuttingPlan.Instance.QueryData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划人工选择更新比容")]
        public string[] UpdateCxx(string para)
        {
            return CuttingPlan.Instance.UpdateCxx(para).ToArray();
        }

        [WebMethod(Description = "裁切计划人工选择填充表格2")]
        public string[] CustomQueryData2(string para)
        {
            return CuttingPlan.Instance.QueryData2(para).ToArray();
        }

        [WebMethod(Description = "裁切计划人工选择保存数据")]
        public string[] SaveCutting(string para)
        {
            return CuttingPlan.Instance.saveData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划查询同规格批次")]
        public string[] QueryOrderCesp(string para)
        {
            return CuttingPlan.Instance.QueryDataOrder(para).ToArray();
        }

        [WebMethod(Description = "裁切计划查询查询已切信息")]
        public string[] UpdateOrderFirstQuery(string para)
        {
            return CuttingPlan.Instance.QueryCuttingOrderFirst(para).ToArray();
        }

        [WebMethod(Description = "裁切计划查询查询未切信息")]
        public string[] QueryNotingCutting(string para)
        {
            return CuttingPlan.Instance.QueryNotingData(para).ToArray();
        }


        [WebMethod(Description = "裁切计划查询信息保存")]
        public string[] SaveCuttingData(string para)
        {
            return CuttingPlan.Instance.SaveCuttingData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划增加QTy")]
        public string[] QuerydQty(string para)
        {
            return CuttingPlan.Instance.QueryQty(para).ToArray();
        }

        [WebMethod(Description = "裁切计划保存增加数据")]
        public string[] AddSaveCuttingData(string para)
        {
            return CuttingPlan.Instance.SaveAddData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划删除数据")]
        public string[] deleteCutting(string para)
        {
            return CuttingPlan.Instance.deleteCuttingData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划Main删除数据")]
        public string[] deleteMainData(string para)
        {
            return CuttingPlan.Instance.deleteMainData(para).ToArray();
        }

        [WebMethod(Description = "裁切计划下发")]
        public string[] CuttingStatusChange(string para)
        {
            return CuttingPlan.Instance.CuttingStatusChange(para).ToArray();
        }

        [WebMethod(Description = "重工单重工后规格查询")]
        public string[] QuerycSpecifutionAfter(string para)
        {
            return reWork.Instance.QuerySpecifution(para).ToArray();
        }

        [WebMethod(Description = "重工单重工前规格查询")]
        public string[] QuerycSpecifutionPre(string para)
        {
            return reWork.Instance.QuerySpecifution(para).ToArray();
        }



        [WebMethod(Description = "重工单重工后物料查询")]
        public string[] QuerycCmatNOAfter(string para)
        {
            return reWork.Instance.QueryMatNo(para).ToArray();
        }

        [WebMethod(Description = "重工单重工前物料查询")]
        public string[] QuerycCmatNOPre(string para)
        {
            return reWork.Instance.QueryMatNo(para).ToArray();
        }

        [WebMethod(Description = "裁切接收查询数据")]
        public string[] CuttingRecData(string para)
        {
            return CuttingRec.Instance.CuttingDataQuery(para).ToArray();
        }

        [WebMethod(Description = "裁切接收插入数据")]
        public string[] UpdateCutting(string para)
        {
            return CuttingRec.Instance.UpdateData(para).ToArray();
        }

    }
}
